package coml.jiyun.hp.wanandroid.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.TextView;

import java.util.List;

import coml.jiyun.hp.wanandroid.FlowLayout;
import coml.jiyun.hp.wanandroid.R;
import coml.jiyun.hp.wanandroid.base.BaseRlvAdapter;
import coml.jiyun.hp.wanandroid.bean.NaviBean;
import coml.jiyun.hp.wanandroid.bean.SystemBean;

public class FlowNaviAdapter extends BaseRlvAdapter<NaviBean.DataBean> {
    public FlowNaviAdapter(Context context, List<NaviBean.DataBean> list) {
        super(context, list);
    }

    @Override
    protected void bindData(BaseViewHolder holder, NaviBean.DataBean dataBean) {
        FlowLayout fl = (FlowLayout) holder.itemView;
        List<NaviBean.DataBean.ArticlesBean> articles = dataBean.getArticles();

        for (int i = 0; i < articles.size() ; i++) {
            NaviBean.DataBean.ArticlesBean articlesBean = articles.get(i);
            TextView tv = (TextView) LayoutInflater.from(mContext).inflate(R.layout.item_flow_system, null);
            tv.setText(articlesBean.getChapterName());
            fl.addView(tv);
        }
    }

    @Override
    protected int getLayout() {
        return R.layout.item_navi;
    }
}
